package com.github.freewu.mvp.view.status;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;

import com.lqkj.commons.R;



/**
 * Created by free on 16-7-20.
 */
public class LoadingView extends FrameLayout {

    private com.github.freewu.loading.LoadingView loadingView;

    public LoadingView(Context context) {
        super(context);

        init();
    }

    public LoadingView(Context context, AttributeSet attrs) {
        super(context, attrs);

        init();
    }

    public LoadingView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);

        init();
    }
    private void init(){
        LayoutInflater.from(getContext()).inflate(R.layout.loading_layout,this);

        loadingView=(com.github.freewu.loading.LoadingView) findViewById(R.id.loadingView);
    }
    public void startProgress(){
        loadingView.startAnimation();
    }
    public void cancelProgress(){
        loadingView.stopAnimation();
    }
    public void removeProgress(){
        loadingView.stopAnimation();
    }
}
